package com.xq.action;
import com.xq.pojo.User;
import com.xq.service.UserService;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/5 15:16
 * @description 用户控制层
 */
public class UserAction {
    private UserService userService;

    /**
     * Spring容器要通过setXXX方法来把容器里面的对象注入到这个UserService类
     * @param userService 用户服务层对象
     */
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void getUserById(){
        Integer id = 1;
        User u = userService.getUserById(id);
        System.out.println(u);
    }
}
